home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
game
/
patch
/
WHDIDemos.lzh
/
Axis_PictureBook.lha
/
PictureBookHD
/
sources
/
picturebookwhd.asm
Wrap
Assembly Source File
|
2002-04-28
|
4KB
|
262 lines
; *** Picture Book Hard Disk Loader V1.0
; *** Written by Mick © 2001
INCLUDE "whdload.i"
INCLUDE "whdmacros.i"
_base
SLAVE_HEADER ;ws_Security + ws_ID
dc.w 10 ;ws_Version
dc.w WHDLF_NoError ;ws_flags
_upchip
dc.l $200000 ;ws_BaseMemSize
dc.l $0 ;ws_ExecInstall
dc.w _Start-_base ;ws_GameLoader
dc.w 0 ;ws_CurrentDir
dc.w 0 ;ws_DontCache
_keydebug
dc.b 0 ;ws_keydebug
_keyexit
dc.b $59 ;ws_keyexit = F10
dc.l 0
dc.w _name-_base
dc.w _copy-_base
dc.w _info-_base
_name
dc.b "Picture Book",0
_copy
dc.b "1995 Axis/Polka Brothers",0
_info
dc.b "installed by Mick",10
dc.b "V1.0 (16.10.2001)",0
cnop 0,4
_Start
lea (_resload,pc),A1
move.l A0,(A1) ;save for later using
move.l #WCPUF_Base_WT|WCPUF_IC,D0
move.l #WCPUF_Base|WCPUF_IC|WCPUF_DC,D1
move.l (_resload,pc),A2
jsr (resload_SetCPU,A2) ; to enable caches
lea (CurrDisk,pc),A0
move.l #1,(A0)
moveq #0,D0
move.l #$400,D1
moveq #1,D2
lea $10000,A0
bsr LoadBoot
move.l #$4E714E71,$1C(A0) ; 4E7B
move.w #$4E75,$14A(A0) ; BFD operand
move.w #$4E75,$128(A0)
move.w #$4E75,$13E(A0)
move.w #$600C,$52(A0)
patch $78(A0),PatchIntro
patch $80(A0),DiskRoutine
move.w #$4E75,$166(A0) ; BFD operand
jmp $16(A0)
PatchIntro
move.l A0,-(A7)
lea $F0000,A0
move.w #$4E71,$1E(A0) ; trap #0
move.l #$4E714E71,$2A(A0) ; 4E7B
patchs $A2(A0),PatchLoading
patchs $EA(A0),PatchPBLogo
patch $142(A0),PatchMain
patch $198(A0),FixInt
move.w #$4E75,$3F0(A0) ; BFD operand
move.w #$4E75,$3CE(A0)
move.w #$4E75,$3E4(A0)
move.w #$600C,$316(A0)
patch $342(A0),DiskRoutine
move.b #$60,$27E(A0)
patch $1AA(A0),FixInt2
patchs $26A(A0),SetDisk2
move.l (A7)+,A0
jmp $F0000
PatchLoading
bsr Delay
bsr Delay
clr.w $F1A44
rts
PatchPBLogo
patch $190072,FixInt2
jsr $190000
rts
PatchMain
move.l A0,-(A7)
lea $70000,A0
move.w #$4E71,$1E(A0) ; trap #0
move.w #$4E75,$522(A0) ; BFD operand
move.w #$4E75,$500(A0)
move.w #$4E75,$516(A0)
move.w #$600C,$448(A0)
patch $474(A0),DiskRoutine
patch $1E0(A0),FixInt
patch $1F2(A0),FixInt2
patch $30B2(A0),FixInt2
patchs $8A(A0),PatchP1
patchs $B2(A0),PatchP2
patchs $E4(A0),PatchP3
patchs $F0(A0),PatchP4
patchs $118(A0),PatchP5
patchs $13C(A0),PatchP6
patchs $156(A0),PatchP7
patchs $178(A0),PatchP8
patchs $336(A0),SetDisk3
patchs $39C(A0),SetDisk4
move.l (A7)+,A0
jmp $70000
PatchP1
jsr $100000
bsr Delay
rts
PatchP2
patch $19A094,FixInt2
jsr $19A000
bsr Delay
rts
PatchP3
patch $F0114,FixInt2
jsr $F0000
rts
PatchP4
patch $C0084,FixInt2
jsr $C0000
rts
PatchP5
patch $1001A8,FixInt2
jsr $100000
rts
PatchP6
patch $C00EA,FixInt2
jsr $C0000
rts
PatchP7
patch $E0D9C,FixInt3
patch $E0DBE,FixInt3
patch $E0DE8,FixInt3
jsr $E0000
PatchP8
cmp.w #$66F6,$C00B6
bne Part8B
rts
Part8B
patch $C009E,FixInt2
Go
jsr $C0000
bsr Delay
rts
Delay
movem.l D0-D7/A0-A6,-(A7)
move.l #120,D0 ; 12 seconds
move.l (_resload,pc),A2
jsr (resload_Delay,A2)
movem.l (A7)+,D0-D7/A0-A6
rts
FixInt
move.w #$20,$DFF09C
move.w #$20,$DFF09C
nop
nop
rte
FixInt2
move.w #$4,$DFF09C
move.w #$4,$DFF09C
nop
nop
rte
FixInt3
move.w #$2000,$DFF09C
move.w #$2000,$DFF09C
nop
nop
rte
LoadBoot
movem.l D0-D2/A0-A2,-(A7)
move.l (_resload,pc),A2
jsr (resload_DiskLoad,A2)
movem.l (A7)+,D0-D2/A0-A2
rts
DiskRoutine
movem.l D0-D7/A0-A6,-(A7)
moveq #0,D0
moveq #0,D1
move.w $2(A5),D0
move.w (A5),D1
mulu #$1600,D0
mulu #$1600,D1
move.l (CurrDisk,pc),D2
move.l (_resload,pc),A2
jsr (resload_DiskLoad,A2)
movem.l (A7)+,D0-D7/A0-A6
rts
SetDisk2
move.l A0,-(A7)
lea (CurrDisk,pc),A0
move.l #2,(A0)
bra Return
SetDisk3
move.l A0,-(A7)
lea (CurrDisk,pc),A0
move.l #3,(A0)
bra Return
SetDisk4
move.l A0,-(A7)
lea (CurrDisk,pc),A0
move.l #4,(A0)
Return
move.l (A7)+,A0
move.l #$1FE000,D2
rts
_exit
pea TDREASON_OK
bra _end
_debug
pea TDREASON_DEBUG
_end
move.l (_resload),-(A7)
add.l #resload_Abort,(A7)
rts
_resload
dc.l 0 ;address of resident loader
even
CurrDisk
dc.l 0